package com.p2p.common.constants;

import java.util.ResourceBundle;

public final class Environment {

    private static Object lock = new Object();
    private static Environment environment = null;
    private static ResourceBundle resourceBundle = null;
    private static final String CONFIG_FILE = "config";

    private Environment() {
        resourceBundle = ResourceBundle.getBundle(CONFIG_FILE);
    }

    public static Environment getInstance() {
        synchronized (lock) {
            if (null == environment) {
                environment = new Environment();
            }
        }
        return (environment);
    }

    public String getValue(String key) {
        return (resourceBundle.getString(key));
    }

}
